<?php

$components = require(__DIR__ . '/components.php');
$params = require(__DIR__ . '/params.php');

$config = [
    'name' => 'Mii Admin',
    'id' => 'backend',
    'timeZone' => 'Asia/Chongqing',
    'language' => 'zh-CN',
    'charset' => 'utf-8',
    'basePath' => dirname(__DIR__),
    'preload' => ['log'],
    'extensions' => require(__DIR__ . '/../vendor/yiisoft/extensions.php'),
    'components' => $components,
    'params' => $params,
    'defaultRoute' => 'dashboard',
    'modules' => [
        'test' => [
            'class' => 'apps\test\backend\Module'
        ],
        'user' => [
            'class' => 'apps\user\backend\Module',
        ],
        'category' => [
            'class' => 'apps\category\backend\Module',
        ],
        'dashboard' => [
            'class' => 'apps\dashboard\backend\Module',
        ],
        'forum' => [
            'class' => 'apps\forum\backend\Module',
        ],
    ],
    'defaultRoute' => 'dashboard/backend/index',
];
$config['components']['view'] = [
    'theme' => [
        'pathMap' => ['@app/views' => '@webroot/themes/backend'],
        'baseUrl' => '@web/themes/backend',
    ],
];

$config['components']['urlManagerFrontend'] = [
    'class' => 'yii\web\urlManager',
    'baseUrl' => '/yii2module/web/index.php',
    'enablePrettyUrl' => false,
    'showScriptName' => false,
];

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['preload'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';
    $config['modules']['gii'] = 'yii\gii\Module';
}


return $config;
